import useServer from "server";
import { ProjectType } from "types";
import { useQuery } from "react-query";

export const useProjects = (param?: Partial<ProjectType>) => {
  const client = useServer();

  return useQuery<ProjectType[]>(["projects", param], () => {
    return client("projects", { data: param });
  });
};
